package com.hrt.bean;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
@Entity
@Table(name = "order_detail")
@JsonIgnoreProperties(value = { "orderInfor","giftDetail"})
public class OrderDetail implements Serializable{
	private static final long serialVersionUID = 1L;
	/**
	 * 详情ID 主键
	 * 
	 * 
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ORDER_DETAIL_ID", nullable = false)
	public Long id;
	/**
	 * 订单ID
	 * 
	 *
	 */
	@Column(name = "ORDER_ID",insertable=false,updatable=false)
	private Long orderId;
	/**
	 * 礼品ID
	 * 
	 *
	 */
	@Column(name = "GIFT_ID")
	private Long giftId;
	/**
	 * 礼品编码
	 */
	@Column(name = "GIFT_CODE")
	private String giftCode;
	/**
	 * 礼品名称
	 * 
	 * 
	 */
	@Column(name = "GIFT_NAME")
	private String giftName;
	/**
	 * 描述
	 */
	@Column(name = "DESCRITION", length = 500)
	private String description;
	/**
	 * 礼品规格ID
	 * 
	 *
	 */
	@Column(name = "GIFT_DETAIL_ID",insertable=false,updatable=false)
	private Long giftDetailId;
	/**
	 * 礼品规格图片
	 */
	@Column(name = "GD_PIC")
	private String gdPic;
	/**
	 * 礼品规格编号
	 */
	@Column(name = "GD_CODE")
	private String gdCode;
	/**
	 * 礼品规格名称
	 * 
	 * 
	 */
	@Column(name = "GD_NAME")
	private String gdName;
	/**
	 * 单价
	 * 
	 * 
	 */
	@Column(name = "SALE_PRICE")
	private Double salePrice=0d;
	/**
	 * 数量
	 * 
	 * 
	 */
	@Column(name = "TOTAL")
	private Integer total = 0;
	/**
	 * 总价
	 * 
	 * 
	 */
	@Column(name = "SUMMERY")
	private Double summery;
	/**
	 * 录入人
	 * 
	 * 
	 */
	@Column(name = "CREATOR")
	private String creator;
	/**
	 * 录入时间
	 * 
	 * 
	 */
	@Column(name = "CREATE_TIME")
	private Timestamp createTime;
	/**
	 * 确认人
	 * 
	 */
	@Column(name = "CONFIRMER")
	private String confirmer;
	/**
	 * 确认时间
	 * 
	 */
	@Column(name = "CONFIRM_TIME")
	private Timestamp confirmTime;
	/**
	 * 备注
	 * 
	 * 
	 */
	@Column(name = "NOTE")
	private String note;
	/**
	 * 最后修改时间,录入时，最后修改时间和录入时间一致
	 * 
	 * 
	 */
	@Column(name = "EDIT_TIME")
	private Timestamp editTime;
	/**
	 * 最后修改人, 录入时，最后修改人和录入人一致
	 * 
	 * 
	 */
	@Column(name = "EDITOR")
	private String editor;
	/**
	 * 删除标记0 未删除 1已删除
	 * 
	 *
	 */
	@Column(name = "IS_DELETE")
	private Integer isdelete = 0;
	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = false)
	@JoinColumn(name = "ORDER_ID")
	private OrderInfor orderInfor;
	
	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = false)
	@JoinColumn(name = "GIFT_DETAIL_ID")
	private GiftDetail giftDetail;
	
	//礼品的描述
	@Transient
	private String giftDescr;
	
	public GiftDetail getGiftDetail() {
		return giftDetail;
	}
	public void setGiftDetail(GiftDetail giftDetail) {
		this.giftDetail = giftDetail;
	}
	
	public Long getGiftId() {
		return giftId;
	}
	public void setGiftId(Long giftId) {
		this.giftId = giftId;
	}
	public String getGiftCode() {
		return giftCode;
	}
	public void setGiftCode(String giftCode) {
		this.giftCode = giftCode;
	}
	public String getGiftName() {
		return giftName;
	}
	public void setGiftName(String giftName) {
		this.giftName = giftName;
	}
	public OrderInfor getOrderInfor() {
		return orderInfor;
	}
	public void setOrderInfor(OrderInfor orderInfor) {
		this.orderInfor = orderInfor;
	}
	
	public String getGdPic() {
		return gdPic;
	}
	public void setGdPic(String gdPic) {
		this.gdPic = gdPic;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getOrderId() {
		return orderId;
	}
	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}
	
	
	public Integer getTotal() {
		return total;
	}
	public void setTotal(Integer total) {
		this.total = total;
	}
	public Double getSummery() {
		return summery;
	}
	public void setSummery(Double summery) {
		this.summery = summery;
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	public Double getSalePrice() {
		return salePrice;
	}
	public void setSalePrice(Double salePrice) {
		this.salePrice = salePrice;
	}
	public String getConfirmer() {
		return confirmer;
	}
	public void setConfirmer(String confirmer) {
		this.confirmer = confirmer;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	public Timestamp getConfirmTime() {
		return confirmTime;
	}
	public void setConfirmTime(Timestamp confirmTime) {
		this.confirmTime = confirmTime;
	}
	public Timestamp getEditTime() {
		return editTime;
	}
	public void setEditTime(Timestamp editTime) {
		this.editTime = editTime;
	}
	public String getEditor() {
		return editor;
	}
	public void setEditor(String editor) {
		this.editor = editor;
	}
	public Integer getIsdelete() {
		return isdelete;
	}
	public void setIsdelete(Integer isdelete) {
		this.isdelete = isdelete;
	}
	public Long getGiftDetailId() {
		return giftDetailId;
	}
	public void setGiftDetailId(Long giftDetailId) {
		this.giftDetailId = giftDetailId;
	}
	public String getGdCode() {
		return gdCode;
	}
	public void setGdCode(String gdCode) {
		this.gdCode = gdCode;
	}
	public String getGdName() {
		return gdName;
	}
	public void setGdName(String gdName) {
		this.gdName = gdName;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	//礼品秒速
	public String getGiftDescr() {
		return giftDescr;
	}
	public void setGiftDescr(String giftDescr) {
		this.giftDescr = giftDescr;
	}
	
}
